﻿
using Dapper;
using HBase;
using System;
using System.Data;
namespace hCommand {
    public class WcsMoveAgvEmplyTask : GkTransaction {
        public long beforeParamId;
        public long paramId; 
        public int src;
        public int des;
        protected override TransRes Execute(IDbConnection connection ,IDbTransaction transaction) {
            CoreTaskParam beforeParam = connection.GetById<CoreTaskParam>(beforeParamId, transaction);
            CoreTaskParam completeParam = new CoreTaskParam();
            completeParam.id = paramId;
            completeParam.taskId = beforeParam.taskId;
            completeParam.param = "";
            completeParam.type = ( int ) TaskParamType.托盘搬运;
            completeParam.des = des;
            completeParam.src = src;
            completeParam.cStn = src;
            completeParam.cDes= des;
            completeParam.status = ( int ) CoreTaskParamStatus.可以接收任务;
            completeParam.taskNo = TaskNoUtil.getTaskNo(connection ,transaction);
            completeParam.createTime = DateTime.Now;
            completeParam.cTaskName = "TaskRgv";
            connection.InsertNoNull(completeParam ,transaction);
            beforeParam.relyParamId = paramId+"";
            connection.updateNotNull(beforeParam ,transaction);
            return new TransRes();
        }
    }
}
